﻿@{
    ViewBag.Title = "ViewAllSong";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    List<ListenMusic.AdminSong_ServiceReference.SongSinger> lst = ViewBag.allSong;
}
<script type="text/javascript">
    function deleteSong(songid) {
        $.ajax({
            url: '/managesong/deleteSong',
            data: { 'songid': songid },
            contentType: 'application/json; charset=utf-8',
            dataType: "json",
            success: function (result) {               
                location.reload();
            }
        });
    }
</script>

    	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="../../Images/AdminImages/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="../../Images/AdminImages/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
			
				<!--  start message-yellow -->
			@*	<div id="message-yellow">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="yellow-left">You have a new message. <a href="">Go to Inbox.</a></td>
					<td class="yellow-right"><a class="close-yellow"><img src="../../Images/AdminImages/table/icon_close_yellow.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>
				<!--  end message-yellow -->
				
				<!--  start message-red -->
				<div id="message-red">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="red-left">Error. <a href="">Please try again.</a></td>
					<td class="red-right"><a class="close-red"><img src="../../Images/AdminImages/table/icon_close_red.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>
				<!--  end message-red -->
				
				<!--  start message-blue -->
				<div id="message-blue">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="blue-left">Welcome back. <a href="">View my account.</a> </td>
					<td class="blue-right"><a class="close-blue"><img src="../../Images/AdminImages/table/icon_close_blue.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>
				<!--  end message-blue -->
			
				<!--  start message-green -->
				<div id="message-green">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="green-left">Product added sucessfully. <a href="">Add new one.</a></td>
					<td class="green-right"><a class="close-green"><img src="../../Images/AdminImages/table/icon_close_green.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>*@
				<!--  end message-green -->
		
		 
				<!--  start product-table ..................................................................................... -->
                
    <div id="step-holder">
            <div class="step-no-off">+</div>
			<div class="step-light-left"><a href="/managesong/NoneActiveSong?pageindex=1">Kiểm duyệt</a></div>
			<div class="step-light-right">&nbsp;</div>
			<div class="step-no">+</div>
			<div class="step-dark-left"><a href="/managesong/viewallsong?pageindex=1">Xem tất cả</a></div>
			<div class="step-dark-right">&nbsp;</div>
			<div class="step-no-off">+</div>
			<div class="step-light-left"><a href="/managesong/uploadSong">Upload bài hát mới</a></div>
			<div class="step-light-right">&nbsp;</div>			
			<div class="clear"></div>
		</div>
				<form id="mainform" action="">
                <h3>Website hiện đang có @ViewBag.countSong bài hát.</h3>
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"><a id="toggle-all" ></a> </th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Tên bài hát</a>	</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Thể loại</a></th>
					<th class="table-header-repeat line-left"><a href="">Ca sĩ</a></th>
					<th class="table-header-repeat line-left"><a href="">Nhạc sĩ</a></th>
					<th class="table-header-repeat line-left"><a href="">Thành viên</a></th>
					<th class="table-header-options line-left"><a href="">Tuỳ chọn</a></th>
				</tr>
                    @for (int i = 0; i < lst.Count; i++)
                    {
                        if (i % 2 == 0)
                        {                 
                        <tr>
					        <td><input type="checkbox"/></td>
					        <td>@lst[i].SongName</td>
					        <td>@lst[i].CategoryName</td>
					        <td><a href="">@lst[i].SingerName</a></td>
					        <td>@lst[i].MusicianName</td>
					        <td><a href="">@lst[i].UserName</a></td>
					        <td class="options-width">	
                            <a href="" title="Cập nhật" class="icon-1 info-tooltip"></a>				       
					        <a href="javascript:deleteSong(@lst[i].SongID)" title="Xoá" class="icon-2 info-tooltip"></a>	
                            @*<a href="" title="Edit" class="icon-3 info-tooltip"></a>
					        <a href="" title="Edit" class="icon-4 info-tooltip"></a>				       
					        <a href="" title="Active" class="icon-5 info-tooltip"></a>*@
					        </td>
				        </tr>
                        }
                        else
                        { 
                            <tr class="alternate-row">
					        <td><input type="checkbox"/></td>
					        <td>@lst[i].SongName</td>
					        <td>@lst[i].CategoryName</td>
					        <td><a href="">@lst[i].SingerName</a></td>
					        <td>@lst[i].MusicianName</td>
					        <td><a href="">@lst[i].UserName</a></td>
					        <td class="options-width">		
                             <a href="" title="Cập nhật" class="icon-1 info-tooltip"></a>				      			       
					        <a href="javascript:deleteSong(@lst[i].SongID)" title="Xoá" class="icon-2 info-tooltip"></a>	
                            @*<a href="" title="Edit" class="icon-3 info-tooltip"></a>
					        <a href="" title="Edit" class="icon-4 info-tooltip"></a>					       
					        <a href="" title="Active" class="icon-5 info-tooltip"></a>*@
					        </td>
				        </tr>
                        }
                    }
				</table>
				<!--  end product-table................................... --> 
				</form>
			</div>
			<!--  end content-table  -->
		
			<!--  start actions-box ............................................... -->
			<div id="actions-box">
				<a href="" class="action-slider"></a>
				<div id="actions-box-slider">
					<a href="" class="action-edit">Edit</a>
					<a href="" class="action-delete">Delete</a>
				</div>
				<div class="clear"></div>
			</div>
			<!-- end actions-box........... -->
			
			<!--  start paging..................................................... -->
			<table border="0" cellpadding="0" cellspacing="0" id="paging-table">
			<tr>
			<td>
                @{
                    ViewBag.next =  ViewBag.pageindex + 1;
                    if(ViewBag.pageindex >= ViewBag.totalSong)
                    {
                        ViewBag.next = ViewBag.totalSong;
                    }
                    ViewBag.pre = ViewBag.pageindex - 1;
                    }
				<a href="/managesong/ViewAllSong?pageindex=1" title="Về trang đầu" class="page-far-left"></a>
				<a href="/managesong/ViewAllSong?pageindex=@ViewBag.pre" class="page-left"></a>
				<div id="page-info">Trang <strong>@ViewBag.pageindex</strong> / @ViewBag.totalSong</div>
				<a href="/managesong/ViewAllSong?pageindex=@ViewBag.next" class="page-right"></a>
				<a href="/managesong/ViewAllSong?pageindex=@ViewBag.totalSong" title="Đến trang cuối" class="page-far-right"></a>
			</td>
			<td>
			<select  class="styledselect_pages" onchange="location = this.options[this.selectedIndex].value">
                <option>Đi nhanh</option>
                 @for (int k = 1; k <= ViewBag.totalSong; k++)
                    {  
                     <option value="/managesong/ViewAllSong?pageindex=@k">@k</option>
                    }				
			</select>
			</td>
			</tr>
			</table>
			<!--  end paging................ -->
			<div class="clear"></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>
<div class="clear">&nbsp;</div>


